package manager;

import java.util.Date;
import java.util.List;

import repository.BalanceRepository;

import model.BalanceHistoryDO;
import model.TradeDO;

import com.iwallet.biz.common.util.money.Money;

public class BalanceManagerImpl implements BalanceManager {
	private BalanceRepository balanceRepository;
	
	@Override
	public Money queryAccBalance(String accNo) {
		return balanceRepository.queryAccBalance(accNo);
	}

	@Override
	public List<BalanceHistoryDO> queryBalanceHistory(String accNo,
			Date startDate, Date endDate) {
		return balanceRepository.queryBalanceHistory(accNo, startDate, endDate);
	}

	public void setBalanceRepository(BalanceRepository br) {
		this.balanceRepository = br;
	}

	@Override
	public boolean transferBalance(TradeDO trade) {
		balanceRepository.transferBalance(trade);
		return false;
	}

}
